import ajax from '@/http/ajax'
import {useToDoList} from "@/store/toDoList";

export default function () {
    const toDoList = useToDoList()

    function delToDo(id: string) {
        ajax({
            url: '/posts/' + id,
            method: 'DELETE'
        }).then(() => {
            toDoList.getData()
        })
    }

    return {delToDo}
}